package com.skwen.delivery.superdelivery.myGreenDao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.skwen.delivery.superdelivery.deliveryOrder.bean.ExpressInfo;
import com.skwen.delivery.superdelivery.deliveryOrder.bean.Order;
import com.skwen.delivery.superdelivery.login.bean.User;
import com.skwen.delivery.superdelivery.order.bean.WriteOrder;

import com.skwen.delivery.superdelivery.myGreenDao.ExpressInfoDao;
import com.skwen.delivery.superdelivery.myGreenDao.OrderDao;
import com.skwen.delivery.superdelivery.myGreenDao.UserDao;
import com.skwen.delivery.superdelivery.myGreenDao.WriteOrderDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig expressInfoDaoConfig;
    private final DaoConfig orderDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig writeOrderDaoConfig;

    private final ExpressInfoDao expressInfoDao;
    private final OrderDao orderDao;
    private final UserDao userDao;
    private final WriteOrderDao writeOrderDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        expressInfoDaoConfig = daoConfigMap.get(ExpressInfoDao.class).clone();
        expressInfoDaoConfig.initIdentityScope(type);

        orderDaoConfig = daoConfigMap.get(OrderDao.class).clone();
        orderDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        writeOrderDaoConfig = daoConfigMap.get(WriteOrderDao.class).clone();
        writeOrderDaoConfig.initIdentityScope(type);

        expressInfoDao = new ExpressInfoDao(expressInfoDaoConfig, this);
        orderDao = new OrderDao(orderDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        writeOrderDao = new WriteOrderDao(writeOrderDaoConfig, this);

        registerDao(ExpressInfo.class, expressInfoDao);
        registerDao(Order.class, orderDao);
        registerDao(User.class, userDao);
        registerDao(WriteOrder.class, writeOrderDao);
    }
    
    public void clear() {
        expressInfoDaoConfig.clearIdentityScope();
        orderDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        writeOrderDaoConfig.clearIdentityScope();
    }

    public ExpressInfoDao getExpressInfoDao() {
        return expressInfoDao;
    }

    public OrderDao getOrderDao() {
        return orderDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public WriteOrderDao getWriteOrderDao() {
        return writeOrderDao;
    }

}
